package com.xhu.service.impl;

import com.xhu.bean.pojo.ChanceManage;
import com.xhu.dao.ChanceDao;
import com.xhu.dao.impl.ChanceDaoImpl;
import com.xhu.service.ChanceService;

import java.util.List;

public class ChanceServiceImpl implements ChanceService {

    private ChanceDao chanceDao=new ChanceDaoImpl();
    @Override
    public List<ChanceManage> queryPage(Integer page, Integer limit) {
        Integer start=(page-1)*limit;
        return chanceDao.queryPage(start,limit);
    }

    @Override
    public boolean add(ChanceManage chanceManage) {
        return chanceDao.add(chanceManage)>0;
    }

    @Override
    public boolean upData(ChanceManage chanceManage, String chance_id) {
        return chanceDao.upData(chanceManage,chance_id)>0;
    }

    @Override
    public boolean del(String chance_id) {
        return chanceDao.del(chance_id)>0;
    }

    @Override
    public boolean distribute(ChanceManage chanceManage, String chance_id) {
        return chanceDao.distribute(chanceManage,chance_id)>0;
    }

    @Override
    public List<ChanceManage> queryPage(Integer page, Integer limit, String search_name) {
        Integer start=(page-1)*limit;
        return chanceDao.queryPage(start,limit,search_name);
    }
}
